using GeneticAlgorithms.Genomes;

namespace GeneticAlgorithms.Operators.Fitness
{
    /// <summary>
    /// Base interface for fitness providers.
    /// </summary>
    /// <typeparam name="TGenome">The type of the genome.</typeparam>
    /// <typeparam name="TGene">The type of the gene.</typeparam>
    /// <remarks>
    /// Fitness providers are in charge of receiving a genome and
    /// calculating its fitness.
    /// </remarks>
    public interface IFitnessProvider<TGenome, TGene> where TGenome : IGenome<TGene>
    {
        /// <summary>
        /// Calculates the fitness of the specified genome.
        /// </summary>
        /// <param name="genome">The genome to be evaluated.</param>
        /// <returns>
        /// A <c>double</c> value, indicating the genome's fitness.
        /// </returns>
        double CalculateFitness(TGenome genome);
    }
}
